// 商户管理
import http from '../helper/http.js'
const path = '/api/adm/v1/'

// 商户管理列表
export let merchantList = ({ enableType, provinceId, cityId, districtId, startTime, endTime, searchType, name, page, num }) => {
  return http.post(`${path}merchant/search`, {
    start_time: startTime,
    end_time: endTime,
    search_type: searchType, // 0 全部 1 商户号 2 商户名称  3 店铺名称 4 联系方式
    name,
    page,
    num,
    enable_type: enableType, // 0 全部 1 禁止  2 启用
    province_id: provinceId,
    city_id: cityId,
    district_id: districtId
  })
}

// 商户余额提现详情
export let getMerwithdrawDetail = ({ id }) => {
  return http.post(`${path}merwithdraw/show`, {
    id
  })
}

// 商户余额提现列表和查询
export let getMerwithdraw = ({ verifyType, startTime, endTime, searchType, page, name, num }) => {
  return http.post(`${path}merwithdraw/search`, {
    verify_type: verifyType, // 审核状态 0全部 1 未处理 2 已审核 3已拒绝
    start_time: startTime,
    end_time: endTime,
    search_type: searchType, // 0 所以符合条件  1 商户id  2 商户姓名 3 商户手机号 4 流水号
    name,
    page,
    num
  })
}

// 商户余额提现审核
export let updateMerwithdraw = ({ id, memo, status }) => {
  return http.post(`${path}merwithdraw/update`, {
    id,
    memo,
    status
  })
}

// 商户列表导出/api/adm/v1/merchant/export
export let merchantExport = (params) => {
  return http.post(`${path}merchant/export`, params)
}

// 商户余额提现导出//api/adm/v1/merwithdraw/export
export let merwithdrawExport = (params) => {
  return http.post(`${path}merwithdraw/export`, params)
}

// 商户收款列表/api/adm/v1/merchant/consume
export let merchantConsume = (params) => {
  return http.post(`${path}merchant/consume`, params)
}
